﻿using System;
using Microsoft.Xna.Framework;
using Terraria.Enums;

namespace Terraria.DataStructures
{
	// Token: 0x02000480 RID: 1152
	public struct NPCAimedTarget
	{
		// Token: 0x170002AE RID: 686
		// (get) Token: 0x060026B5 RID: 9909 RVA: 0x0001AEB2 File Offset: 0x000190B2
		public bool Invalid
		{
			get
			{
				return this.Type == NPCTargetType.None;
			}
		}

		// Token: 0x170002AF RID: 687
		// (get) Token: 0x060026B6 RID: 9910 RVA: 0x0001AEBD File Offset: 0x000190BD
		public Vector2 Center
		{
			get
			{
				return this.Position + this.Size / 2f;
			}
		}

		// Token: 0x170002B0 RID: 688
		// (get) Token: 0x060026B7 RID: 9911 RVA: 0x0001AEDA File Offset: 0x000190DA
		public Vector2 Size
		{
			get
			{
				return new Vector2((float)this.Width, (float)this.Height);
			}
		}

		// Token: 0x060026B8 RID: 9912 RVA: 0x00492B44 File Offset: 0x00490D44
		public NPCAimedTarget(NPC npc)
		{
			this.Type = NPCTargetType.NPC;
			this.Hitbox = npc.Hitbox;
			this.Width = npc.width;
			this.Height = npc.height;
			this.Position = npc.position;
			this.Velocity = npc.velocity;
		}

		// Token: 0x060026B9 RID: 9913 RVA: 0x00492B94 File Offset: 0x00490D94
		public NPCAimedTarget(Player player, bool ignoreTank = true)
		{
			this.Type = NPCTargetType.Player;
			this.Hitbox = player.Hitbox;
			this.Width = player.width;
			this.Height = player.height;
			this.Position = player.position;
			this.Velocity = player.velocity;
			if (!ignoreTank && player.tankPet > -1)
			{
				Projectile projectile = Main.projectile[player.tankPet];
				this.Type = NPCTargetType.PlayerTankPet;
				this.Hitbox = projectile.Hitbox;
				this.Width = projectile.width;
				this.Height = projectile.height;
				this.Position = projectile.position;
				this.Velocity = projectile.velocity;
			}
		}

		// Token: 0x0400436F RID: 17263
		public NPCTargetType Type;

		// Token: 0x04004370 RID: 17264
		public Rectangle Hitbox;

		// Token: 0x04004371 RID: 17265
		public int Width;

		// Token: 0x04004372 RID: 17266
		public int Height;

		// Token: 0x04004373 RID: 17267
		public Vector2 Position;

		// Token: 0x04004374 RID: 17268
		public Vector2 Velocity;
	}
}
